<template name="adminFlex">
	<aside class="sidebar-light sidebar--medium" role="navigation">
		<header class="sidebar-flex__header">
			<h1 class="sidebar-flex__title">{{_ "Administration"}}</h1>
			<button class="sidebar-flex__close-button" data-action="close">
				{{> icon block="sidebar-flex__close-icon" icon="cross"}}
			</button>
		</header>
		<div class="rooms-list {{#if embeddedVersion}}rooms-list--embedded{{/if}}" aria-label="{{_ "Administration"}}">
			<ul class="rooms-list__list">
				{{> sidebarItem menuItem "Info" "info-circled" "admin" "info" }}

				{{#if hasPermission 'run-import'}}
					{{> sidebarItem menuItem "Import" "import" "admin-import" "" }}
				{{/if}}

				{{#if hasPermission 'view-room-administration'}}
					{{> sidebarItem menuItem "Rooms" "hashtag" "admin-rooms" "" }}
				{{/if}}

				{{#if hasPermission 'view-user-administration'}}
					{{> sidebarItem menuItem "Users" "team" "admin-users" "" }}
				{{/if}}

				{{#each adminBoxOptions}}
					{{#if permissionGranted}}
						{{> sidebarItem menuItem label icon href "" }}
					{{/if}}
				{{/each}}
			</ul>

			{{#if hasSettingPermission}}
				<h3 class="rooms-list__type">{{_ "Settings"}}</h3>
				<div class="rc-input sidebar-flex__search">
					<label class="rc-input__label">
						<div class="rc-input__wrapper">
							<div class="rc-input__icon">
								{{> icon block="rc-input__icon-sv" icon="magnifier"}}
							</div>
							<input type="text" class="rc-input__element rc-input__element--small" name="settings-search" placeholder="{{_ 'Search'}}">
						</div>
					</label>
				</div>
				<ul class="rooms-list__list">
					{{#each groups}}
						{{> sidebarItem menuItem label false "admin" _id }}
					{{else}}
						<div class="rc-input sidebar-flex__search">
							<div class="rc-input__wrapper">
								<p>{{_ "Nothing_found"}}.</p>
							</div>
						</div>
					{{/each}}
				</ul>
			{{/if}}
		</div>
	</aside>
</template>
